<template>
  <div class="app-container company-info-container">
    <div class="company-header">
      <h1 class="company-title">德国ASL物流有限责任公司</h1>
      <el-divider class="title-divider" />
    </div>

    <div class="info-section">
      <h2 class="section-title">
        <i class="el-icon-office-building"></i> 企业简介
      </h2>
      <div v-html="form.companyProfileZh" class="company-content rich-text"></div>
    </div>

    <div class="info-section">
      <h2 class="section-title">
        <i class="el-icon-s-flag"></i> 企业文化
      </h2>
      <div class="company-content culture-content">{{ form.corporateCultureZh }}</div>
    </div>

    <div class="info-section">
      <h2 class="section-title">
        <i class="el-icon-location-information"></i> 企业定位
      </h2>
      <div class="company-content">{{ form.companyPositionZh }}</div>
    </div>

    <div class="info-section">
      <h2 class="section-title">
        <i class="el-icon-view"></i> 企业愿景
      </h2>
      <div class="company-content vision-content">{{ form.companyVisionZh }}</div>
    </div>

    <div class="info-section">
      <h2 class="section-title">
        <i class="el-icon-medal"></i> 优势介绍
      </h2>
      <div v-html="form.advantagesZh" class="company-content rich-text"></div>
    </div>
  </div>
</template>

<script>
import { listSysCompanyInfo } from "@/api/sysCompanyInfo/sysCompanyInfo";

export default {
  name: "CompanyInfo",
  data() {
    return {
      // 企业信息表单
      form: {
        companyProfileZh: '',
        corporateCultureZh: '',
        companyPositionZh: '',
        companyVisionZh: '',
        advantagesZh: ''
      }
    }
  },
  created() {
    this.loadCompanyInfo();
  },
  methods: {
    /** 加载企业信息数据 */
    loadCompanyInfo() {
      listSysCompanyInfo({
        pageNum: 1,
        pageSize: 1
      }).then(response => {
        if (response.rows && response.rows.length > 0) {
          this.form = response.rows[0];
        }
      });
    }
  }
}
</script>

<style scoped lang="scss">
.company-info-container {
  margin: 0 auto;
  padding: 30px;
  background-color: #fff;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  border-radius: 8px;

  .company-header {
    text-align: center;
    margin-bottom: 40px;

    .company-title {
      font-size: 28px;
      font-weight: 500;
      color: #303133;
      margin-bottom: 15px;
    }

    .title-divider {
      margin: 0 auto;
      width: 100px;
      background-color: #409EFF;
      height: 3px;
    }
  }

  .info-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px dashed #e6e6e6;

    &:last-child {
      border-bottom: none;
    }

    .section-title {
      font-size: 22px;
      font-weight: 500;
      color: #409EFF;
      margin-bottom: 20px;
      display: flex;
      align-items: center;

      i {
        margin-right: 10px;
        font-size: 24px;
      }
    }

    .company-content {
      font-size: 16px;
      line-height: 1.8;
      color: #606266;
      text-align: justify;
      padding: 0 20px;

      &.rich-text {
        >>> p {
          margin-bottom: 15px;
          &:last-child {
            margin-bottom: 0;
          }
        }

        >>> img {
          max-width: 100%;
          height: auto;
          border-radius: 4px;
          margin: 10px 0;
          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }
      }

      &.culture-content {
        font-style: italic;
        color: #666;
        background-color: #f8f9fa;
        padding: 20px;
        border-left: 4px solid #409EFF;
        border-radius: 0 4px 4px 0;
      }

      &.vision-content {
        font-weight: 500;
        color: #303133;
        font-size: 18px;
      }
    }
  }
}

@media (max-width: 768px) {
  .company-info-container {
    padding: 20px 15px;

    .company-header .company-title {
      font-size: 24px;
    }

    .info-section {
      .section-title {
        font-size: 20px;
      }

      .company-content {
        font-size: 15px;
        padding: 0 10px;
      }
    }
  }
}
</style>
